Skip to content

chore(ci): migrate disabled Trivy scan to reusable Grype workflow - #18

Merged
mattmattox merged 2 commits into
mainfrom
chore/trivy-to-grype
Jul 10, 2026
Merged

chore(ci): migrate disabled Trivy scan to reusable Grype workflow#18
mattmattox merged 2 commits into
mainfrom
chore/trivy-to-grype

Conversation

@mattmattox

@mattmattox mattmattox commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Replace the disabled (if: false) per-repo Trivy security-scan job in .github/workflows/pipeline.yml with a caller of the org-wide reusable SupportTools/ci-runners/.github/workflows/grype-scan.yml@main workflow, for consistency with other repos.
  • The new grype-scan job stays effectively opt-in/non-blocking: it keeps if: false (same reason as before — the KubeTTY image is too large to scan practically in CI) and sets blocking: false on the reusable workflow, so it will never gate the pipeline even if enabled later. needs: [build] wires it to the build job and it scans the exact image built there via ${{ needs.build.outputs.image-digest }} (by digest, so it always matches the pushed image regardless of tag scheme).
  • Renamed the corresponding needs.security-scan reference in the (also disabled, if: false) "Verify security scan passed" step in deploy-production to needs.grype-scan.
  • Removed every aquasecurity/trivy-action step (SARIF scan, blocking scan, SBOM generation) — no trivy-action references remain in the workflow.
  • validate-pipeline-local.sh: swapped its local best-effort Trivy checks for the direct Grype equivalents (grype "$IMAGE_TAG" for the informational pass, grype "$IMAGE_TAG" --fail-on critical for the blocking pass) — this was a trivial, obvious command swap, so no TODO was needed.
  • Added an empty .grype.yaml (ignore: []) since no .trivyignore existed previously; this matches the reusable workflow's default config input.

Notes

  • Because grype-scan stays if: false, it will not run on this PR — that's expected/by design (mirrors the prior Trivy job's disabled state). Validated YAML with python3 -c 'import yaml; yaml.safe_load(...)' and confirmed shell syntax with bash -n.

Test plan

  • python3 -c "import yaml; yaml.safe_load(open('.github/workflows/pipeline.yml'))" passes
  • bash -n validate-pipeline-local.sh passes
  • No remaining trivy-action or aquasecurity/trivy-action references in .github/workflows/
  • CI checks pass on this PR (grype-scan job itself will be skipped, as intended)

Update: switched to in-line anchore/scan-action (grype engine)

KubeTTY pipeline.yml is pull_request-triggered. The org reusable grype-scan.yml (private-repo reusable workflow) fails to resolve at workflow-load time on pull_request, which 0-job-startup-failed the entire pipeline run even with if: false (GitHub resolves the reusable uses: before evaluating if:). Replaced the reusable job with an in-line anchore/scan-action@v6 step, kept disabled (if: false, image too large to scan in CI) exactly as before. An in-line action has no load-time resolution problem, so PR CI is no longer broken.

Replace the per-repo (if: false) Trivy security-scan job with a caller
of SupportTools/ci-runners' reusable grype-scan.yml, keeping it
opt-in/non-blocking (if: false + blocking: false) since the KubeTTY
image is still too large to scan practically in CI. Also swaps the
local best-effort validate-pipeline-local.sh trivy checks for their
direct grype equivalents, and adds an empty .grype.yaml (no
.trivyignore existed previously).

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 902a00bf31

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .github/workflows/pipeline.yml Outdated
if: false # Disabled - KubeTTY image too large for Grype to scan in CI (same reasoning as the prior Trivy job)
uses: SupportTools/ci-runners/.github/workflows/grype-scan.yml@main
with:
image: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}@${{ needs.build.outputs.image-digest }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Avoid env context in reusable workflow inputs

Because this job calls a reusable workflow, jobs.<job_id>.with.<input_id> expressions are limited to the github and needs contexts per GitHub's workflow syntax, so the newly added ${{ env.REGISTRY }} / ${{ env.IMAGE_NAME }} references make .github/workflows/pipeline.yml invalid at parse time even though the job has if: false. Every push or PR that loads this workflow will be rejected before CI jobs are scheduled; hard-code this image prefix or pass it through an output from a needed job.

Useful? React with 👍 / 👎.

pipeline.yml is pull_request-triggered, and the private-repo reusable
grype-scan.yml fails to resolve at workflow-load time on pull_request, failing
the entire run at startup (0 jobs) even with if: false (resolution precedes if).
Replace the reusable uses: with an in-line anchore/scan-action@v6 step, keeping
the job disabled (if: false) as before (image too large to scan in CI).
@mattmattox
mattmattox merged commit 9b81102 into main Jul 10, 2026
9 of 13 checks passed
@mattmattox
mattmattox deleted the chore/trivy-to-grype branch July 10, 2026 02:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant